<template>
  <div @click="onPreview">home</div>
  <el-button type="primary">buttonCont</el-button>
</template>

<script lang='ts'>
import { defineComponent, getCurrentInstance } from 'vue';
import { testRequest } from '@/api/test';

export default defineComponent({
  setup() {
    testRequest();
    const instance = getCurrentInstance();
    const preview = instance?.appContext.config.globalProperties.$preview;
    const onPreview = () => {
      preview({
        source: [
          'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1517417813,2367413112&fm=26&gp=0.jpg',
          'https://yyc-dev-opt-1303934766.cos.ap-beijing.myqcloud.com/202011/144115205301725084/-1981016115-%E6%9C%89%E6%89%8B%E5%B0%B1%E8%83%BD%E4%BC%9A_%E8%B6%85%E6%98%BE%E8%84%B8%E5%B0%8F%E8%BF%AA%E5%A3%AB%E5%B0%BC%E5%85%AC%E4%B8%BB%E7%BC%96%E5%8F%91%EF%BD%9C%E4%B8%87%E8%83%BD%E5%8F%91%E5%9E%8B.mp4',
          'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3649178992,1821853682&fm=26&gp=0.jpg'
        ],
        current: 0
      });
    };
    return {
      onPreview
    };
  }
});
</script>
